package com.chaopei.customer_server.serrvice.impl;

import com.chaopei.customer_server.serrvice.MyService;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @Author Corday 天涯
 * @Date 2022/4/26 16:42
 */
@Service
public class MyServcieImpl implements MyService {
    @Resource//Rest+Ribbon的实现
    private RestTemplate rt;

    @Override
    public String getJson(String info) {//也可以用restful风格
        return rt.getForObject("http://provider-server/give?inf=" + info, String.class);
    }
}
